<div class="row">
    <div class="col-md-12">
        <!-- Custom Tabs -->
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li class="<?php echo $tab == 'flavor' ? 'active' : '' ?>"><?php echo $this->Html->link('Flavors',array('controller'=>'video','action'=>'setting/flavor')) ?></li>
                <li class="<?php echo $tab == 'player' ? 'active' : '' ?>"><?php echo $this->Html->link('Player',array('controller'=>'video','action'=>'setting/player')) ?></li>
                <li class="pull-right">&nbsp;</li>
            </ul>
            <div class="tab-content">
                <?php if($tab == 'flavor') { //echo '<pre>';print_r($data);echo '</pre>'; ?>
                <div class="tab-pane <?php echo $tab == 'flavor' ? 'active' : '' ?>" id="tab_1">
                    <?php echo $this->Form->create('flavor', array('url' => array('controller' => 'video', 'action' => 'setting/flavor'))); ?>
                    <div class="box box-solid">
                        <div class="box-body no-padding">
                            <table class="table">
                              <tbody>
                                  <tr>
                                      <th>#</th>
                                      <th>Device Name</th>
                                      <th>Flavor Name</th>
                                      <th>Bitrate</th>
                                      <th>Video Bitrate</th>
                                      <th>Audio Bitrate</th>
                                      <th>Resolution</th>
                                      <th>Frame Rate (FPS)</th>
                                      <th>Keyframe Rate</th>
                                  </tr>
                                  <?php foreach($data as $key=>$val) { ?>
                                  <tr>
                                      <td><?php echo $this->Form->checkbox('flavor_'.$val['Flavor']['id'],array('class'=>'form-control','label'=>false)); ?></td>    
                                      <td><?=$val['Flavor']['device_name']?></td>
                                      <td><?=$val['Flavor']['flavor_name']?></td>
                                      <td><?=$val['Flavor']['bitrate']?></td>
                                      <td><?=$val['Flavor']['video_bitrate']?></td>
                                      <td><?=$val['Flavor']['audio_bitrate']?></td>
                                      <td><?=$val['Flavor']['width'].'*'.$val['Flavor']['height']?></td>
                                      <td><?=$val['Flavor']['frame_rate']?></td>
                                      <td><?=$val['Flavor']['keyframe_rate']?></td>
                                  </tr>
                                  <?php } ?>
                              </tbody>
                          </table>
                        </div><!-- /.box-body -->
                        <div class="box-footer">
                            <button class="btn btn-primary btn-sm" type="submit">Save</button>
                        </div>
                    </div><!-- /.box -->
                    <?php echo $this->Form->end(); ?>
                </div>
                <?php }elseif($tab == 'player') { ?>
                <link href="<?php echo Router::url('/', true); ?>css/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet" type="text/css" />
                <div class="tab-pane <?php echo $tab == 'player' ? 'active' : '' ?>" id="tab_3">
                    <?php echo $this->Form->create('player', array('url' => array('controller' => 'video', 'action' => 'setting/player'))); ?>
                    <div class="box-group" id="accordion">
                        <div class="panel box box-solid">
                            <div class="box-header">
                                <h4 class="box-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
                                        General Settings
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseOne" class="panel-collapse collapse in">
                                <div class="box-body">
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('player_type',array('options'=>$player_type,'class'=>'form-control','label'=>'Player Type','empty' => 'Select')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('player_skin',array('options'=>$player_skin,'class'=>'form-control','label'=>'Player Skin','empty' => 'Select')); ?>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('height',array('class'=>'form-control','placeholder'=>'Height','label'=>'Height','type'=>'number')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('width',array('class'=>'form-control','placeholder'=>'Width','label'=>'Width','type'=>'number')); ?>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('player_aspectration',array('options'=>$aspect_ration,'class'=>'form-control','label'=>'Aspect Ration','empty' => 'Select')); ?>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('related_video',array('class'=>'form-control','label'=>false)); ?>&nbsp;Related Video</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('social_sharing',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Social Sharing</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('repeat_video',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Repeat Video</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('auto_start',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Auto Start</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('controls',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Controls</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('google_analytics',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Google Analytics</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('mute',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Mute</label>
                                        </div>
                                        <div class="form-group col-lg-2">
                                            <label><?php echo $this->Form->checkbox('androidhls',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Androidhls</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel box box-solid">
                            <div class="box-header">
                                <h4 class="box-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
                                        Logo Settings
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseTwo" class="panel-collapse collapse">
                                <div class="box-body">
                                   <div class="row">
                                        <div class="form-group col-lg-12">
                                            <?php echo $this->Form->input('logo_link',array('class'=>'form-control','placeholder'=>'Logo Link','label'=>'Logo Link')); ?>
                                        </div>
                                   </div>
                                   <div class="row">
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('logo_position',array('options'=>$logo_position,'class'=>'form-control','label'=>'Logo Position','empty' => 'Select')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('logo_margin',array('class'=>'form-control','placeholder'=>'Logo Margin','label'=>'Logo Margin','type'=>'number')); ?>
                                        </div>
                                   </div>
                                   <div class="row">
                                        <div class="form-group col-lg-12">
                                            <label><?php echo $this->Form->checkbox('logo_hide',array('class'=>'form-control','label'=>false)); ?>&nbsp;&nbsp;Logo Hide</label>
                                        </div>
                                    </div>
                                   <div class="row">
                                        <div class="form-group col-lg-12">
                                            <button class="btn btn-default btn-sm" type="submit">Upload Logo</button>
                                            <span class="text-red">(jpg, jpeg, png, gif)</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel box box-solid">
                            <div class="box-header">
                                <h4 class="box-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
                                        Caption Settings
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseThree" class="panel-collapse collapse">
                                <div class="box-body">
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <label for="exampleInputEmail1">Caption color</label>
                                            <div class="input-group my-colorpicker">                                            
                                                <?php echo $this->Form->input('caption_color',array('class'=>'form-control','placeholder'=>'Caption Color','label'=>false)); ?>
                                                <div class="input-group-addon">
                                                    <i></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('caption_fontsize',array('class'=>'form-control','placeholder'=>'Caption Font Size','label'=>'Caption Font Size','type'=>'number')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('caption_fontfamily',array('options'=>$font,'class'=>'form-control','label'=>'Caption Font Family','empty' => 'Select')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('caption_fontopacity',array('options'=>$range,'class'=>'form-control','label'=>'Caption Font Opacity','empty' => 'Select')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label for="exampleInputEmail1">Caption Background Color</label>
                                            <div class="input-group my-colorpicker">                                            
                                                <?php echo $this->Form->input('caption_backgroundcolor',array('class'=>'form-control','placeholder'=>'Caption Background Color','label'=>false)); ?>
                                                <div class="input-group-addon">
                                                    <i></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('caption_backgroundopacity',array('options'=>$range,'class'=>'form-control','label'=>'Caption Background Opacity','empty' => 'Select')); ?>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label for="exampleInputEmail1">Caption Window Color</label>
                                            <div class="input-group my-colorpicker">                                            
                                                <?php echo $this->Form->input('caption_windowcolor',array('class'=>'form-control','placeholder'=>'Caption Window Color','label'=>false)); ?>
                                                <div class="input-group-addon">
                                                    <i></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <?php echo $this->Form->input('caption_windowopacity',array('options'=>$range,'class'=>'form-control','label'=>'Caption Window Opacity','empty' => 'Select')); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                        <div class="panel box box-solid">
                            <div class="box-header">
                                <h4 class="box-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">
                                        Right Click Settings
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseFour" class="panel-collapse collapse">
                                <div class="box-body">
                                    <div class="row">
                                        <div class="form-group col-lg-12">
                                            <?php echo $this->Form->input('about_text',array('class'=>'form-control','placeholder'=>'About Text','label'=>'About Text')); ?>
                                        </div>
                                        <div class="form-group col-lg-12">
                                            <?php echo $this->Form->input('about_link',array('class'=>'form-control','placeholder'=>'About Link','label'=>'About Link')); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                        </div>
                    </div>
                    <div class="box-footer">
                        <button class="btn btn-primary btn-sm" type="submit">Save</button>
                        <button class="btn btn-default btn-sm" type="submit">Set as default</button>
                     </div>
                    <?php echo $this->Form->end(); ?>
                    <script src="<?php echo Router::url('/', true); ?>js/plugins/colorpicker/bootstrap-colorpicker.min.js" type="text/javascript"></script>
                    <script>
                        $(function(){
                            //Colorpicker
                            $('.my-colorpicker').colorpicker();
                        });
                    </script>
                </div>
                <?php } ?>            
            </div><!-- /.tab-content -->
        </div><!-- nav-tabs-custom -->
    </div><!-- /.col -->
</div> <!-- /.row -->